package cn.edu.gsau.info.dao;

import cn.edu.gsau.info.models.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jinjiang
 * @since 2022-11-17
 */
public interface UserDao extends BaseMapper<User> {
    @Select("SELECT *\n" +
            "FROM tbl_user\n" +
            "WHERE tbl_user.id=(SELECT tbl_review.userId\n" +
            "\t\t\tFROM tbl_review\n" +
            "\t\t\tWHERE moduleId=#{id})")
    User selectByUserId(long id);
}
